from public.action import *
from public.business import *
from public.testData import *
from public.tools import *

testCase = "DBshop008_销售管理支付记录"

firefox = openBrowser(urlAdmin) #打开后台网页
DBshopLoginAdmin(firefox)   #后台登录

# 1.点击销售管理支付记录。
DBshopEnterMenu2(firefox,"销售管理","支付记录")
# 2,点击"订单号"按钮，查看订单已发货还是未发货。
rootPath=get_pro_rootpath() #获取项目的绝对路径
filePath=rootPath+r'\public\order1.txt' #拼接文件路径
orderNo=readFile(filePath) #读取文件中的订单编号
firefox.find_element_by_link_text(("%s")%orderNo).click()

s=firefox.find_element_by_xpath("//div[@class='pull-left']").text
print(s)
l = "订单 "+orderNo+".*"+"\("
r = "\)"
zi = reGetString(s,l,r)
print(zi)

#断言
if zi != "已付款":
    writeLog("%s 测试通过" % testCase)
else:
    writeLog("%s 测试不通过" % testCase)
    getPhoto(firefox)
firefox.quit()
